# person_info = {
#     "name": "Alex",
#     "age": 30,
#     "country": "USA",
#     "language": ["English", "Spanish"],
#     "is_student": False
# }
#
# print(person_info["name"])
#
# person_info["age"] = 31
# print(person_info["age"])
#
# person_info.update({"height" : 175, "weight" : 80})
# print(person_info)
#
# del person_info["is_student"]
# print(person_info)
#
# print(person_info.pop("weight", "键不存在")) #pop 删除键值对 返回value值 如果键不存在则返回第二个参数
#
# for key, value in person_info.items():
#     print(key, value)
#
# person_info.update({"email" : "alex@example.com"})
# print(person_info)
#
# # person_info.update({"language" : ["English"]})
# # print(person_info)
#
# print(len(person_info.get("language", "键不存在")))
#
# person_info.get("language").append("French")
# print(person_info.get("language"))
#
# for i in [1,2,3]:
#     person_info["hobby"+str(i)] = i
#
# print(person_info)



employees = {
    101: {
        "name": "Alice",
        "age": 30,
        "gender": "Female",
        "position": "Data Scientist",
        "team": "Research",
        "salary_history": [70000, 80000, 90000]
    },
    # 更多员工数据...
}

employees.update({102: {
    "name": "Bob",
    "age": 28,
    "gender": "Male",
    "position": "Software Engineer",
    "team": "Development",
    "salary_history": [60000, 65000, 70000]
}})
# print(employees)

# employees.pop(102)
# print(employees)
#
# employees.get(101).update({"age": 31})
# print(employees)
#
# employees.get(101).get("salary_history").append(95000)
# print(employees)
#
# print(sum(employees.get(101).get("salary_history"))/len(employees.get(101).get("salary_history")))

# for i in employees.keys():
#     if employees.get(i).get("age") > 25:
#         print(employees.get(i).get("name"))
#         print(i)

# for i in employees.keys():
#     employees.get(i).update({"bonus": employees.get(i).get("salary_history")[-1]*0.1})
#
# print(employees)
#
# employees.get(101).update({"position": "Senior Data Scientist"})
# print(employees)

# for i in employees.keys():
#     employees.get(i).pop("gender")
#
# print(employees)
dict1 = {}
for i in employees.keys():
    dict1[i] = {
        "name": employees.get(i).get("name"),
        "position": employees.get(i).get("position")
    }
print(dict1)

# print(employees[101])